var Object = function(){};


Object.extend = function(child,parent){
    /**
    其实 原理类似 child.prototype = parent.prototype
    但是这样的话 child.prototype.test 会造成父类的原型也拥有这个函数
    所以需要一个F
    **/
    var F  = function(){};
    F.prototype = parent.prototype;
    var f= new F();
    child.prototype = f;
    return child;
}

var A = function(){
    console.log('a');
};
var B = function(){
    console.log('b');
};
B = Object.extend(B,A);
debugger;
var b = new B();
console.log(b instanceof B);



